Assignemnt #45 and Fourty-second Program

Code

      ///Name: Derrick Andreasen
///Period: 7
///Program name: fourty-second Program
///File name: FourtsProg.java
///Date Finished:10/19/2015

import java.util.Scanner;

public class FourtsProg
{
	public static void main( String[] args )
	{
        Scanner keyboard = new Scanner(System.in);
        
        String answer, answer2, answer3, answer4, answer5, answer6, answer7, answer8;
        
        System.out.println( "Welcome to Derrick's short adventure." );
        
        System.out.println( "You are in a forest. up ahead is a creepy house. Do you enter the house, yes or no." );
        System.out.print( "> " );
        answer = keyboard.next();
        
        if(answer.equals("yes"))
        {
            System.out.println( "You enter the house and see that it is empty. you see two ways to go, into the kitchen or upstairs. which do you choose?" );
            System.out.print( ">" );
            answer2 = keyboard.next();
            
            if(answer2.equals("kitchen"))
            {
                System.out.println( "You enter the kitchen. You remember that you haven't eaten in days. What do you do, check the fridge for food or try to find a Burger King in the woods?" );
                System.out.print( ">" );
                answer3 = keyboard.next();
                
                if(answer3.equals("fridge"))
             {
                System.out.println( "You find some food in the fridge and eat it. After one bite you realize that it's rotten." );
                 System.out.print("");
                System.out.print( "YOU DIED!" );
             }
                
               else if(answer3.equals("search"))
                {
                System.out.println( "You leave the house and search the forest for a Burger King. You have no luck. Hungry land sharks soon find you and make you their meal." );
                    System.out.print("");
                System.out.print( "YOU DIED!" );
               }
            }
                
                else if(answer2.equals("upstairs"))
                {
                System.out.println( "You decide againts going into the kitchen and begin your ascent up the mountain of steps.once reaching the top you look around and see three rooms. you go to the room on the left and try opening the door. It doesn't open. you look at the other two rooms. do you go left or right?" );
                System.out.print( "> " );
                answer4 = keyboard.next();
                    
                    if(answer4.equals("left"))
                {
                    System.out.println( "You go into the room on the left. You notice that it is a toddlers room. there is a chest of toys and a crib. which do you examine." );
                    System.out.print( "> " );
                    answer5 = keyboard.next();
                        
                        if(answer5.equals("toys"))
                    {
                    System.out.println("You go over to the toy chest and open it. As you open it a blood curdiling scream can be heard from inside the box. A spirt leaps out and eats your soul.");
                        System.out.print("");
                    System.out.print( "YOU DIED!" );
                    }
                    
                   else if(answer5.equals("crib"))
                    {
                    System.out.println( "You walk over to the crib and look inside. You see nothing but as soon as you look away the door closes. you remember that you haven't eaten in a long time and you soon starve to death." );
                        System.out.print("");
                    System.out.print( "YOU DIED!" );
                   }
                }
                    
                    else if(answer4.equals("right"))
                    {
                        System.out.println( "You enter the room on the right and see that it is the master bedroom. You are very tired do you rest in the bed?" );
                        System.out.print( ">" );
                        answer6 = keyboard.next();
                        
                        if(answer6.equals("yes"))
                        {
                            System.out.println( "You lay down on the bed and quickly fall asleep." );
                            System.out.println( "You seem to be in another world, on top of a large building. You have a parachute on your back. Do you jump or climb down the ladder?" );
                            System.out.print(">");
                            answer7 = keyboard.next();
                            
                            if(answer7.equals("jump"))
                            {
                            System.out.println( "You jump and quickly pull the parachute release cord. Nothing happens and you fall to your death." );
                                System.out.print("");
                            System.out.print( "YOU DIED!" );
                            }
        
                           else if(answer7.equals("ladder"))
                            {
                            System.out.println( "You begin climbing down the ladder. half way down your hands become sweaty. do you wipe them one at a time or keep going." );
                                System.out.print( ">" );
                                answer8 = keyboard.next();
                               
                               if(answer8.equals("keep going"))
                            {
                                System.out.println( "You decide to keep going. Your hands feel ten times as sweaty as before. You cant hold on anymore. You fall to your death." );
                                System.out.print("");
                                System.out.print( "YOU DIED!" );
                            }
                
                               else if(answer8.equals("wipe"))
                                {
                                    System.out.println( "You decide to wipe your hands one hand at a time. You climb down the ladder and enter a strange building. The building only has one room and in the center is a white table with a cake on top of it. you eat the cake and learn the secrets of the ancient races that once lived on the planet." );
                                    System.out.print("");
                                    System.out.print( "YOU WIN!" );
                       
                               }
                           }
                        }
                            
                            else if(answer6.equals("no"))
                            {
                                System.out.println( "You decide not to go to sleep but your body disagrees with you. Your eyelids shut and you fall to the ground. You never wake because you were eaten by hungry land sharks." );
                                System.out.print("");
                                System.out.print( "YOU DIED!" );
                            }
                    }
                }
        }
            
            else if(answer.equals("no"))
        {
            System.out.println( "a pack of hungry land sharks find you and eat you." );
            System.out.print("");
            System.out.print( "YOU DIED!" );
            }  
    }
}

Picture of the output

Assignment 45 Assignment 45